using System.Data.Linq;
using System;

namespace RomanJendrusz.Amazon.ETL.Domain
{
    public class SimiliarBook
    {
        private EntityRef<Book> similiar;
        private EntityRef<Book> booksSimiliarTo;

        public SimiliarBook()
        {
            similiar = new EntityRef<Book>();
            booksSimiliarTo = new EntityRef<Book>();
        }

        private string similiarBookAsin;
        private string bookSimiliarToAsin;
        private DateTime updated;

        public DateTime Updated
        {
            get { return updated; }
        }

        public Book BooksSimiliarTo
        {
            get { return booksSimiliarTo.Entity; }
            set
            {
                booksSimiliarTo.Entity = value;
                if(value != null)
                bookSimiliarToAsin = value.Asin;
            }
        }

        public Book Book
        {
            get { return similiar.Entity; }
            set
            {
                similiar.Entity = value;
                if (value != null)
                similiarBookAsin = value.Asin;
            }
        }
    }
}